#include<iostream>
using namespace std;
void ThreatTree(BinTreeNode* p)
{
	static BinTreeNode* pre = NULL;
	if (p == NULL) {
		return NULL;
	}
	ThreatTree(p->lchild);
	if (p->lchild == NULL)
	{
		p->ltag = 1;
		p->lchild = pre;
	}
	if (pre != NULL && pre->rchild == NULL)
	{
		pre->rtag = 1;
		pre->rchild = p;
	}
	pre = p;
	ThreatTree(p->rchild);
}